home *** CD-ROM | disk | FTP | other *** search
-
-
- Chapter 6: Modem Stuff 86
-
-
-
-
- 6 Modem Stuff
-
-
- Modems are finicky beasts, and cajoling them into talking to your
- Fnordadel properly can be a tricky piece of business. This chapter, then,
- deals with the various modem configuration options in Fnordadel, and gives
- some tips on how to make a recalcitrant modem behave.
-
-
-
- 6.1 Basic Modem Requirements
-
- To run a Fnordadel, you must have a modem possessing a modicum of basic
- features. These are:
-
- o Must be able to auto-answer the phone.
-
- o Must be able to respond to DTR (Data Terminal Ready) line control by
- the computer. DTR is supposed to be pin 20 on the RS-232 connector.
- Ideally, the modem should be able to hang up the phone, disable auto
- answer, and go to `command' mode when the computer flips DTR off (and
- reverse the above when DTR goes high).
-
- o Must have the CD (Carrier Detect) line tracking the status of the
- carrier. CD (or DCD) is supposed to be pin 8 on the RS-232 connector.
-
- o If you want to do any calling out (i.e., during networking or
- whatever), the modem must be able to autodial the phone using a command
- string.
-
- Most modems are perfectly capable of all of the above. If your modem is
- advertised as being ``Hayes-compatible'', then it *should* work fine. The
- DTR and CD settings will likely have to be adjusted, since most modems do
- not by default listen to DTR and most leave the CD line high all the time.
- These behaviours can be changed either by using a DIP-switch or in the
- software; it's almost always possible.
-
- STadel 3.3b, from which Fnordadel is descended, was advertised to work
- with the following list of modems, and there's no reason to believe that
- we've introduced any incompatibilities:
-
- o Avatex 1200, 1200E, 1200HC, 2400HC
-
- o Everex 2400
-
- o FastComm 19200
-
- o Hayes 1200, 2400
-
- o Incomm 2400
-
- o MultiTech 1200, 2400
-
- o Prometheus 2400B2
-
- o Supra 2400
-
-
-
- Chapter 6: Modem Stuff 87
-
-
-
-
- o Telebit Trailblazer 19,200
-
- o USR Courier 2400, HST 9600
-
- The Fnordadel developers both use the Supra 2400; we've been running 24
- hours a day for a few years now and have had no problems with the wee
- beasties. Your mileage may vary, of course.
-
-
-
- 6.2 Setting Up the Modem
-
- If your modem meets the above criteria, then we're off. (If it doesn't,
- then go buy a real modem---1200 and 2400 baud Hayes compatible modems
- are dirt cheap these days.) In this section we'll describe some of the
- `ctdlcnfg.sys' options for the modem.
-
-
- 6.2.1 Baud rate
-
- You must tell Fnordadel the highest baud rate at which the modem
- will function; this is accomplished by setting the variable #sysbaud in
- `ctdlcnfg.sys'. #sysbaud can have any one of the following values:
-
- 0 300 bps only
-
- 1 300 and 1200 bps
-
- 2 300, 1200 and 2400 bps
-
- 3 300, 1200, 2400 and 9600 bps
-
- 4 300 up to 19200 bps
-
- Note that 4800 bps is not supported. The ST serial port will do 4800,
- but we've never heard of a modem that will, other than ones that will also
- go faster. If for some reason you find yourself in dire need of 4800, see
- Appendix A [Fnordadel Support], page 170.
-
-
- 6.2.2 Initialisation
-
- Hayes compatible modems, at least, understand a set of commands to
- control their behaviour. Fnordadel requires that the modem be set up in a
- certain way; thus, you must define a command string which will be sent to
- the modem every time Fnordadel wants to reset the modem. Simply put a line
- like the following:
-
- #modemsetup "AT &C1 &D2 V0 E0 M0 Q0 X4 S0=1\r%10"
-
- in your `ctdlcnfg.sys'. The example above will work on many
- Hayes-compatible modems. The various parts mean:
-
- o The initial `AT' tells the modem that a command string is coming.
-
-
-
- Chapter 6: Modem Stuff 88
-
-
-
-
- o `&C1 &D2' sets up the required behaviour for the CD and DTR lines
- (see Section 6.1 [Basic Modem Requirements], page 86). If your modem
- controls CD and DTR with hardware switches, it probably will not
- support these commands, so you may have to remove them.
-
- o `V0 E0 M0 Q0' selects numeric result codes (see Section 6.2.3.2 [Result
- codes], page 89), turns off command echoing, turns off the built-in
- speaker, and turns on result codes.
-
- o `X4' tells the modem to return the full range of result codes (see
- Section 6.2.3.2 [Result codes], page 89).
-
- o `S0=1' tells the modem to answer the phone on the first ring.
-
- o `\r' represents a carriage return, which must be there to terminate the
- command string.
-
- o And finally, `%10' is a special notation which causes Fnordadel to
- pause for 10 tenths of a second (i.e., one second). This is necessary
- for some modems, which take a comparatively long time to process the
- command string. (See the front of `ctdlcnfg.doc' for more on the
- format of these sorts of string variables.)
-
- Please be warned that your modem may not recognise some or all of the
- above codes; they may be different, or absent, or whatever. We've seen
- some pretty mental modem behaviour, so be sure to read your modem manual.
-
- A trick which has proved useful with many modems is as follows: If the
- modem allows you to save its settings in non-volatile RAM (i.e., if the
- settings can be preserved when the modem is powered off), then you can
- use a terminal program of some kind to manually set up the modem the way
- Fnordadel wants it, by sending your version of the above command string
- to the modem. Then use the command to save settings (usually `AT&W' or
- something). At this point you can simply use `ATZ\r%10' as the #modemsetup
- string; `ATZ' has the effect of resetting the modem to the saved state.
- The advantage of this is that the string is shorter, so it can speed things
- up a bit, especially during networking or auto-dialing when the modem is
- being reset many times.
-
-
- 6.2.3 Baud-rate detection
-
- Fnordadel must be able to detect the baud rate of incoming calls, and
- it has a couple of ways to accomplish this. The first is by searchbaud,
- and the second is using result codes. Result codes are by far the better
- method, and since most modems can support the feature, we recommend it.
-
-
-
- Chapter 6: Modem Stuff 89
-
-
-
-
- 6.2.3.1 Searchbaud
-
- If you define the `ctdlcnfg.sys' variable #searchbaud to be `1', it
- will cause Fnordadel to loop through the range of supported baud rates
- (as defined by #sysbaud; see Section 6.2.1 [Baud rate], page 87), waiting
- one-half second at each rate for a carriage return (`<CR>') from the
- caller. The upshot of this is that callers must hit `<CR>' once or twice
- when they connect with the BBS.
-
- If #searchbaud is `0', then your BBS will work at *only* the highest
- baud rate represented by #sysbaud. This is last-resort stuff, kids.
- You should normally run with #searchbaud set to `1' unless your modem
- absolutely fails to properly detect other speed connections. (If your
- modem is this stupid, it might be time to consider getting another one.)
-
- The variable #connectprompt modifies the behaviour of #searchbaud
- slightly; if defined to be `1', it causes Fnordadel to loop through the
- baud rates, spitting out a prompt which says ``Type return'' and waiting
- for a `<CR>' for a while; it does all this until the user hits `<CR>' at
- some baud rate, or until it gives up.
-
- Anyway, this is all pretty ugly, really; a far better method is to use
- result codes.
-
-
- 6.2.3.2 Result codes
-
- Most modems, Hayes-compatible ones included, will send a code to the
- computer when they pick up a carrier; furthermore, they can usually be
- configured to return a different code depending on the speed of the
- connection. We utilise this to our advantage.
-
- There is a `ctdlcnfg.sys' variable for each baud rate that Fnordadel
- supports (#reply300 through #reply19200) which you should set to match the
- string that your modem returns when it connects at that baud rate. For
- example:
-
- #reply300 "1"
- #reply1200 "5"
- #reply2400 "10"
-
- are the usual settings for a Hayes-compatible 2400-baud modem. (As always,
- your mileage may vary.)
-
- Please note that the defined reply strings must be sent (by the modem)
- terminated with a carriage return; however, don't put `\r' in the #reply
- strings. (i.e., if the 300 baud reply sent from the modem is `1\r', use
- `#reply300 "1"'.)
-
- If you've got the #reply strings defined in `ctdlcnfg.sys', then
- Fnordadel will use the result code method instead of the searchbaud stuff.
- You must have a #reply string for each permissible baud rate (i.e., if you
- defined `sysbaud 1', then you need a #reply300 and a #reply1200 defined
- before Fnordadel will use the result code method.)
-
-
-
- Chapter 6: Modem Stuff 90
-
-
-
-
- Note also that you must have the modem set up to return the codes
- properly. See Section 6.2.2 [Initialisation], page 87.
-
-
- 6.2.3.3 2400-baud operation
-
- Many 2400-baud modems have a slight quirk. They will not connect with
- a 2400 baud caller unless they have been initialised with the serial port
- set at 2400 baud; they will, however, connect with any lower baud rate no
- matter what speed they're initialised at. We don't know why this is; but
- if your modem is like this, there's a `ctdlcnfg.sys' parameter (well, two,
- actually) which will help.
-
- Simply define the variable #init-speed to be the baud rate at which the
- modem should be initialised; the permissible values are the same as for
- #sysbaud (see Section 6.2.1 [Baud rate], page 87). In the case of the
- quirky 2400 baud modems, put `init-speed 2' and the problem will go away.
-
- Another way of fixing it is to define #hs-bug to be `1'. This causes
- Fnordadel to initialise the modem at the highest supported baud rate, which
- is specified by #sysbaud. Either method works.
-
-
- 6.2.3.4 Connect delay
-
- Some modems, we understand, will croak if a character is sent to them
- too quickly after they connect with an incoming caller. This could happen
- if you've got both searchbaud and connectprompt set. If it does happen,
- then set connectdelay to be the number of seconds to wait after carrier is
- first detected, before sending anything.
-
-
- 6.2.4 Dialing out
-
- If you want to do any networking, or if you just want to use your
- Fnordadel as a terminal program, then you have to tell it some stuff about
- how to make your modem dial the phone.
-
-
- 6.2.4.1 The dialing commands
-
- The relevant `ctdlcnfg.sys' variables are #calloutprefix and
- #calloutsuffix. As you'd expect, they should be defined as the strings
- used to start and end a dialing command. The string sent to the modem will
- consist of:
-
- <calloutprefix><number><calloutsuffix>
-
- For Hayes-compatible modems, the following settings work:
-
- #calloutprefix "ATD"
- #calloutsuffix "\r"
-
- An optional `T' or `P' may be put after `ATD' to specify Touch-Tone or
- Pulse (rotary) dialing. If your modem is not standard Hayes, then look it
- up in the manual.
-
-
-
- Chapter 6: Modem Stuff 91
-
-
-
-
- 6.2.4.2 Long-distance dialing
-
- If the variable #usa is defined to be `1', then Fnordadel assumes it is
- in North America and will form the dial string for a long-distance number
- as follows:
-
- <calloutprefix>1<area code><number><calloutsuffix>
-
- If #usa is `0', Fnordadel will simply spit the number out as-is.
-
-
- 6.2.4.3 Timing
-
- Two more `ctdlcnfg.sys' variables are used to tell Fnordadel how long to
- wait for a connection when dialing out. The two variables are #local-time
- and #ld-time; they default to 25 seconds and 50 seconds respectively. (The
- time used for long-distance (``ld'') dialing is longer because of delays in
- the phone system.)
-
-
-
- 6.2.4.4 A speed-up
-
- If you define the variable #hayes to be `1', then Fnordadel will
- blithely assume that the modem returns `3' for `NO CARRIER' and `7' for
- `BUSY' when it's dialing out. This is a useful kludge to speed up dialing
- out; otherwise, you've got to wait for the defined amount of time (see
- Section 6.2.4.3 [Timing], page 91) to pass before Fnordadel will realise
- that the call is not going to be successful.
-
- Please note that defining #hayes has no other effect; it will not cause
- Fnordadel to assume anything else about the nature of your modem.
-
-
- 6.3 High-Speed Modems
-
- Getting high-speed modems (9600 bps and up) to work with your system
- isn't quite as straight forward as with lower-speed units. For one thing,
- if you're using TOS 1.4 or higher, there is a glitch that prevents hardware
- (RTS/CTS) flow control from working. To fix the problem, you need to
- install tos14fx2.prg in your AUTO folder. See Section 13.1 [Things to Make
- Fnordadel Work or Work Better], page 151.
-
- For another thing, high-speed modems are typically able to talk to your
- Atari at a fixed speed (usually 19,200 bps), and handle the online user's
- varying connect speed themselves. To make this work properly, you don't
- want your Fnordadel to try altering the serial port speed; instead, you
- want it locked at a fixed setting. This is done by setting #sysbaud to
- the speed at which you wish the system locked, #searchbaud to `0', and
- all the result code strings to the null string, "". See Section 6.2.3.1
- [Searchbaud], page 89, and Section 6.2.3.2 [Result codes], page 89.
-
- Two side-effects of port locking are that file transfer time estimates
- will be out of whack, and the `calllog.sys' file will show all users
- connected at the locked speed. These problems will be fixed some day.
-
-
-
- Chapter 6: Modem Stuff 92
-
-
-
-
- 6.4 Common Modem Problems
-
- o "The modem won't work properly at 2400 baud! Help!"
-
- See Section 6.2.3.3 [2400-baud operation], page 90.
-
- o "What happens if I turn the modem off while someone is online?"
-
- Nothing bad. Because you've got the #modemsetup string defined
- (you *have* got it defined, right? If not, see Section 6.2.2
- [Initialisation], page 87), the BBS will simply detect the loss of
- carrier and immediately reinitialise the modem properly for the next
- caller, logging the previous caller off.
-
- o "My Blistering-Speed-of-Deth 153,600 baud modem won't work right with
- Fnordadel! Help!"
-
- Please send us two of the modems in question, and we promise to have
- Fnordadel working flawlessly with them right away!
-
-